home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 6 / QRZ Ham Radio Callsign Database - Volume 6.iso / pc / files / mac / varilogs.hqx / Logs / Logging Stacks USA / QSO log / card_2926.txt < prev    next >
Encoding:
Text File  |  1987-12-15  |  1.7 KB  |  62 lines

  1. -- card: 2926 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2794
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 8006
  11. -- rect: left=302 top=288 right=310 bottom=466
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Import Data Base
  20. ----- HyperTalk script -----
  21. --to use this button, prepare at least as many HC background fields
  22. --as fields separated by tabs of your text data file
  23. --    by Ted Tripp, 4588 CR 523, Bayfield, CO 81122, 303-884-9029
  24. on mouseUp
  25.   ask "Import text from which file?"
  26.   if it is empty then exit mouseUp
  27.   put it into fileName
  28.   open file fileName
  29.   set cursor to 4
  30.   repeat
  31.     read from file fileName until return -- get first record
  32.     if it is empty then
  33.       doMenu "Delete Card"
  34.       close file fileName
  35.       exit mouseUp
  36.     end if
  37.     put it into data
  38.     repeat with i = 1 to the number of fields
  39.       put offset(tab,data) into num --gets first field (until tab)
  40.       if num is 0 then -- last field of record has no tab
  41.         put data into field i -- writes last field
  42.         delete last char of field i -- deletes return char
  43.         if first char of field i is quote then
  44.           delete first char of field i
  45.           delete last char of field i
  46.         end if
  47.         exit repeat -- stops
  48.       end if
  49.       put char 1 to (num - 1) of data into field i -- writes first field
  50.       if first char of field i is quote then
  51.         delete first char of field i
  52.         delete last char of field i
  53.       end if
  54.       delete char 1 to num of data -- gets rid of field
  55.     end repeat
  56.     doMenu "New Card"
  57.   end repeat
  58.   close file fileName
  59.   set cursor to 1
  60. end mouseUp
  61.  
  62.